Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d251522cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if summary and not force: | ||
| message_sent = context.get("message_sent_this_turn", False) | ||
| if not message_sent: |
There was a problem hiding this comment.
Account for non-text send tools before blocking end
This new guard blocks end whenever message_sent_this_turn is false, but in this commit only send_message/send_private_message set that flag. Other user-facing tools (for example render_markdown and render_latex) can already send content via sender/send_image_callback without updating this key, so a valid flow of "send image, then end with summary" is now rejected and can force extra model loops or force=true workarounds.
Useful? React with 👍 / 👎.
| force = args.get("force", False) | ||
|
|
||
| # 检查:如果有 summary 但本轮未发送消息,且未强制执行,则拒绝 | ||
| if summary and not force: |
There was a problem hiding this comment.
Validate force as bool before bypassing end guard
The bypass uses force = args.get("force", False) and then checks if summary and not force, so any truthy non-boolean value (e.g. a model-emitted string "false") disables the protection. Because parse_tool_arguments preserves value types, malformed but common tool-call payloads can skip the unsent-message check unintentionally.
Useful? React with 👍 / 👎.
在 OneBotClient send_group_message/send_private_message 成功后统一写入 RequestContext 的 message_sent_this_turn。 end 工具读取消息发送标记时增加 RequestContext 回退,避免依赖各工具单独打标。 force 参数仅接受 bool,非 bool 记录 warning 并按 false 处理。
修复内容
1. 修复工具名误加前缀问题
skills/registry.py在注册工具时使用了原始 config 而不是处理后的 item.configmemory.memory.add)item.config替代原始 config,确保工具名正确2. 修复工具配置中的分隔符问题
memory.add)3. 完善上下文注入
memory_storage和runtime_configai_coordinator.py和scheduler.py4. 优化 naga agent 文件读取工具
max_chars- 可选的最大字符数限制5. 修复 end 工具的消息发送检查
force- 强制结束对话,跳过未发送消息检查context["message_sent_this_turn"] = Truetools/end/handler.py- 添加检查逻辑toolsets/messages/send_message/handler.py- 添加标记toolsets/messages/send_private_message/handler.py- 添加标记